﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

namespace MidSoft.projectinfo
{
    public partial class projectinfo : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            #region 加载菜单
            ChinaSoft.BLL.Common.Bind bllBind = new ChinaSoft.BLL.Common.Bind();
            DataSet ds = bllBind.GetDataSet("*", "V_RolePower", "UserAccount='" + ChinaSoft.Common.Input.SetString(Session["UserAccount"]) + "' and (PowerId  between 10 and 12) order by Sort,CreateTime desc");
            string result = string.Empty;
            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                DataTable dt = ds.Tables[0];
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                        result = GetResult(result, dt.Rows[i]["PowerId"]);
                }
            }
            literMenu.Text = result;
            #endregion
        }

        private string GetResult(string result, object input)
        {
            switch (ChinaSoft.Common.Input.SetInt(input))
            {
                case 10:
                    result += "<li><a href=\"javascript:routeToWorkSpace('/ProjectInfo/List.aspx')\" title='项目维护'>项目维护</a></li>";
                    break;
                case 11:
                    result += "<li><a href=\"javascript:routeToWorkSpace('/ProjectInfo/ProjectCareList.aspx')\" title='我关注的项目'>我关注的项目</a></li>";
                    break;
                case 12:
                    result += "<li><a href=\"javascript:routeToWorkSpace('/ProjectInfo/ProjectList.aspx')\" title='项目清单'>项目清单</a></li>";
                    break;
            }
            return result;
        }
    }
}